<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('修改四闲场所信息')"/>
    <th:block th:include="include :: jasny-bootstrap-css"/>
    <th:block th:include="include :: datetimepicker-css"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-places-edit" th:object="${places}">
        <input name="ywlsh" th:field="*{ywlsh}" type="hidden">
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">地址名称：</label>
            <div class="col-sm-8">
                <input name="dzmc" th:field="*{dzmc}" class="form-control" type="text" readonly>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">房主姓名：</label>
            <div class="col-sm-8">
                <input name="fzXm" th:field="*{fzXm}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">房主公民身份号码：</label>
            <div class="col-sm-8">
                <input name="fzGmsfhm" th:field="*{fzGmsfhm}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">房主联系电话：</label>
            <div class="col-sm-8">
                <input name="fzLxdh" th:field="*{fzLxdh}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">使用形式：</label>
            <div class="col-sm-8">
                <select name="syxs" class="form-control m-b" th:with="type=${@dict.getParamValue('SQJW_SYXS')}">
                    <option th:each="dict : ${type}" th:text="${dict.itemText}" th:value="${dict.itemValue}"
                            th:field="*{syxs}"></option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">房屋类别：</label>
            <div class="col-sm-8">
                <select name="fwlbdm" class="form-control m-b" th:with="type=${@dict.getParamValue('SQJW_FWLB')}"
                        required>
                    <option th:each="dict : ${type}" th:text="${dict.itemText}" th:value="${dict.itemValue}"
                            th:field="*{fwlbdm}"></option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">房屋用途：</label>
            <div class="col-sm-8">
                <select name="fwytdm" class="form-control m-b" th:with="type=${@dict.getParamValue('SQJW_FWYT')}"
                        required>
                    <option th:each="dict : ${type}" th:text="${dict.itemText}" th:value="${dict.itemValue}"
                            th:field="*{fwytdm}"></option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">房屋管理级别：</label>
            <div class="col-sm-8">
                <input name="fwgljb" th:field="*{fwgljb}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">房屋性质：</label>
            <div class="col-sm-8">
                <select name="fwcqxzzldm" class="form-control m-b" th:with="type=${@dict.getParamValue('SQJW_FWXZ')}"
                        required>
                    <option th:each="dict : ${type}" th:text="${dict.itemText}" th:value="${dict.itemValue}"
                            th:field="*{fwcqxzzldm}"></option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">房屋面积：</label>
            <div class="col-sm-8">
                <input name="fwmjMjpfm" th:field="*{fwmjMjpfm}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">房屋间数：</label>
            <div class="col-sm-8">
                <input name="fwjs" th:field="*{fwjs}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">房屋是否托管：</label>
            <div class="col-sm-8">
                <select name="fwtg" class="form-control m-b"
                        th:with="type=${@dict.getParamValue('SFZD_DQJC')}">
                    <option th:each="dict : ${type}" th:text="${dict.itemText}"
                            th:value="${dict.itemValue}"
                            th:field="*{fwtg}"></option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">所属派出所：</label>
            <div class="col-sm-8">
                <input name="sspcs" th:field="*{sspcs}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">所属民警账号：</label>
            <div class="col-sm-8">
                <input name="ssmjZh" th:field="*{ssmjZh}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">所属民警姓名：</label>
            <div class="col-sm-8">
                <input name="ssmjXm" th:field="*{ssmjXm}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">所属网格：</label>
            <div class="col-sm-8">
                <input name="sssqjwwgDzbm" th:field="*{sssqjwwgDzbm}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">网格员姓名：</label>
            <div class="col-sm-8">
                <input name="wgyXm" th:field="*{wgyXm}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">管区负责人姓名：</label>
            <div class="col-sm-8">
                <input name="gqfzrXm" th:field="*{gqfzrXm}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">社区（村）居委会：</label>
            <div class="col-sm-8">
                <input name="sqjwh" th:field="*{sqjwh}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">建筑名称：</label>
            <div class="col-sm-8">
                <input name="jzmc" th:field="*{jzmc}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">门牌号：</label>
            <div class="col-sm-8">
                <input name="mph" th:field="*{mph}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">地址位置：</label>
            <div class="col-sm-8">
                <input name="dzwz" th:field="*{dzwz}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">地址是否存在：</label>
            <div class="col-sm-8">
                <select name="dzsfcz" class="form-control m-b"
                        th:with="type=${@dict.getParamValue('SFZD_DQJC')}">
                    <option th:each="dict : ${type}" th:text="${dict.itemText}"
                            th:value="${dict.itemValue}"
                            th:field="*{dzsfcz}"></option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">地址是否在用：</label>
            <div class="col-sm-8">
                <select name="dzsfzy" class="form-control m-b"
                        th:with="type=${@dict.getParamValue('SFZD_DQJC')}">
                    <option th:each="dict : ${type}" th:text="${dict.itemText}"
                            th:value="${dict.itemValue}"
                            th:field="*{dzsfzy}"></option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">图片：</label>
            <div class="col-sm-8 fileinput input-group "
                 th:classappend="${photo} ? 'fileinput-exists' : 'fileinput-new'" data-provides="fileinput"
                 style="text-align: center; margin-bottom: 0;">
                <div class="fileinput-preview thumbnail" data-trigger="fileinput"
                     style="width: 200px; height: 150px; margin-right: 10px;">
                    <img th:if="${photo}" th:src="@{'/sys/common/view/' + ${photo}}">
                </div>
                <span class="btn btn-white btn-file"><span class="fileinput-new">选择图片</span><span
                        class="fileinput-exists">更改</span><input name="photo" type="hidden" th:value="${photo}"><input
                        id="williamYe" type="file"></span>
                <a href="#" class="btn btn-white fileinput-exists" data-dismiss="fileinput">清除</a>
            </div>
        </div>
    </form>
</div>
<th:block th:include="include :: footer"/>
<th:block th:include="include :: jasny-bootstrap-js"/>
<th:block th:include="include :: datetimepicker-js"/>
<script type="text/javascript">
    var prefix = ctx + "control/places";

    $("#form-places-edit").validate({
        focusCleanup: true
    });

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/edit", $('#form-places-edit').serialize());
        }
    }

    $('#williamYe').on('change.bs.fileinput ', function (e) {
        // 处理自己的业务
        if (this.files[0]) {
            const formData = new FormData();
            formData.append('file', this.files[0]);
            $.operate.fileUpload(formData, $('input[name="photo"]'));
        } else {
            $('input[name="photo"]').val("");
        }
    });
</script>
</body>
</html>
